package exercises.leetcode;

import java.util.Scanner;

/**
 * <a href="">
 * </a>
 *
 * <p><span color="#87CEEB">描述:</span>
 *
 * @author or2
 * @date 2021年10月24日 时间: 10:08
 */
public class Saike_01_J {
    private static long res = 0;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long total = scanner.nextLong();

        res += total / 160;
        dfs( res / 10 * 3, res % 10);
        System.out.println(res);
    }

    private static void dfs(long star, long rest) {
        if (star < 5) return;

        long curRes = star / 5;
        res += curRes;
        star %= 5;
        star += (curRes + rest) / 10 * 3;
        rest = (curRes + rest) % 10;
        dfs(star, rest);
    }
}
